home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / tutor / pcl61a.arj / PART2.EXE / DOS2.TUT < prev    next >
Text File  |  1993-08-16  |  19KB  |  373 lines

  1.        
  2.        ---------------------------------------------------------------- 
  3.  
  4.                              INTERMEDIATE DOS COMMANDS 
  5.  
  6.        ---------------------------------------------------------------- 
  7.  
  8.        Life gets more interesting the longer you stay in the game. The 
  9.        more you want to accomplish with a computer, the more you need 
  10.        additional DOS commands. However, let's take a side trip to 
  11.        the keyboard and study several powerful DOS shortcuts.
  12.        
  13.        The keyboard function keys labelled F1 through F10 access a 
  14.        special buffer storage area of DOS. Additional key combinations 
  15.        offer other shortcuts. Some keyboards have twelve function keys 
  16.        while others have the function keys arranged along the top of 
  17.        the keyboard rather than stacked along the side. 
  18.  
  19.        The best way to understand how the function keys work is to 
  20.        pause and explain the concept of a keyboard buffer which is 
  21.        little more than a temporary storage area in the computer's 
  22.        memory. A buffer is necessary because the activities of input 
  23.        and output (using the keyboard or printer) are much slower than 
  24.        those activities which interact with the speedy RAM memory chips 
  25.        and CPU. 
  26.  
  27.        Data from the keyboard is placed into a memory buffer area until 
  28.        you signal the PC that you are ready to move on to the next 
  29.        task. Usually this signal is the carriage return or enter key. A 
  30.        buffer storage area can vary in size. For the DOS command line 
  31.        buffer, up to 127 characters can be contained. When data is 
  32.        entered into the keyboard buffer is stays there until flushed 
  33.        out. DOS allows some limited repeating and editing of data 
  34.        stored in the buffer (data you previously typed at the keyboard) 
  35.        by use of the function keys. 
  36.        
  37.                             The FUNCTION Keyboard:
  38.        
  39.        The following discussion applies to the function keys WHEN 
  40.        YOU ARE USING DOS! When you use an application such as your word 
  41.        processor or database program the function keys will probably 
  42.        have different uses!
  43.        
  44.        The function keys assume different roles for different programs. 
  45.        F1 through F5 have special meaning within DOS. They help in 
  46.        reissuing/editing the last DOS command typed.         
  47.  
  48.        F1 Repeats one character per keystroke of the previous DOS command 
  49.        typed. 
  50.  
  51.        F2 Repeats characters stored in the buffer up to the character 
  52.        you typed after pressing F2. 
  53.  
  54.        F3 Repeats the entire LAST command. USEFUL! Repeat last command 
  55.        and edit it over again with other function keys or the backspace 
  56.        key. 
  57.  
  58.        F4 Deletes all characters in the buffer up to the character you 
  59.        typed after F4. The buffer is not displayed. To see the buffer 
  60.        on screen tap F3. 
  61.  
  62.        F5 Stores the current line for re-editing. F5 is used with the 
  63.        other four keys so you can repair long DOS commands which 
  64.        weren't typed in properly.  When you press F5 the current line 
  65.        will be marked and the cursor will move down one line WITHOUT a 
  66.        new prompt. Then use the other function keys to finish editing. 
  67.  
  68.                                The main Keyboard
  69.    
  70.        Delete key deletes character on or to the right of the cursor
  71.  
  72.        Backspace key removes last character typed - to the left of 
  73.        cursor 
  74.  
  75.        Insert key puts keyboard into insert mode    
  76.  
  77.        Escape key voids current input and exits or escapes to previous 
  78.        settings
  79.  
  80.        PageUp key in many applications moves you up one screen of text
  81.  
  82.        PageDown key in many applications moves you down one screen of 
  83.        text 
  84.  
  85.        Left and right arrow keys move cursor left and right without 
  86.        deleting 
  87.  
  88.        Numlock key toggles (goes back and forth) between numbers on the 
  89.        numeric keypad and cursor control (functions such as page down, 
  90.        move cursor right, etc)      
  91.  
  92.        Pressing two or more keys at the same time produces further 
  93.        results. You may hold down the Control (Ctrl) key and then 
  94.        press another key for a required result. Here are some two key 
  95.        combinations. Hold down the first key, then press the second:
  96.  
  97.        Shift-PrtSc prints one screen of data on your printer. 
  98.  
  99.        Control-C or Control Break Aborts current DOS command. USEFUL! 
  100.  
  101.        Control-H or backspace removes last character typed 
  102.  
  103.        Control-P or Control-PrtSc sends output to printer until turned 
  104.        off by typing same key combination (Control P) a second time. 
  105.        Whatever appears on screen will be sent to printer until turned 
  106.        off with control P a second time. This is a little used, often 
  107.        forgetten and HIGHLY useful key combination! 
  108.        
  109.        Control Numlock or Control S pauses screen output. Press any key 
  110.        to continue
  111.  
  112.        Control-Alt-Delete keys together shuts down computer and WIPES 
  113.        OUT all computer data!  This is also called a "warm boot" 
  114.        as compared to a cold boot (completely turning off computer, 
  115.        then turning back on again.) Either of these methods means that 
  116.        ALL DATA AND PROGRAMS LOST from RAM memory but whatever data 
  117.        stored on disk(s) remains.
  118.  
  119.        Other keys have special meanings and can be confused with their 
  120.        look-alike twins: the slash (/) and Backslash (\) are different 
  121.        but easily confused as are the apostrophe (') and grave accent (`), 
  122.        and also the capital O and Zero (0.) 
  123.  
  124.        ---------------------------------------------------------------- 
  125.  
  126.                        ADDITIONAL DOS COMMANDS AND METHODS
  127.        
  128.        ---------------------------------------------------------------- 
  129.  
  130.        Now on to some of the more advanced DOS commands, files and 
  131.        methods which we continue from the previous DOS tutorial: 
  132.  
  133.        -- AUTOEXEC.BAT -- is not a DOS command but a small text file 
  134.        which gives the user an automatic way to specify a precise 
  135.        series of DOS commands whenever the computer is started each 
  136.        day. Within AUTOEXEC.BAT you can specify system variables such 
  137.        as the PATH and PROMPT commands, load or start a menu system 
  138.        with a variety of program choices, load memory resident "TSR" 
  139.        programs such as a calculator or notepad, run other batch files 
  140.        or start one specific program such as your word processor every 
  141.        time the computer is turned on. You can create or modify an 
  142.        AUTOEXEC.BAT file with any word processor which saves text in 
  143.        ASCII (plain text) format. Additional comments and explanations 
  144.        about the AUTOEXEC.BAT file are provided in the batch file 
  145.        tutorial elsewhere within PC-Learn. Following is a listing of 
  146.        the contents within a sample AUTOEXEC.BAT file. Note that it is 
  147.        simply a series of DOS commands which will be given every time 
  148.        the computer is first turned on. This list of autoexec.bat 
  149.        comamnds are only a sample, there are other variations which
  150.        might be more appropriate for your computer. 
  151.        
  152.        echo off
  153.        date
  154.        time
  155.        path \dos;\wp;\util;\doc;\bat                     
  156.        prompt $P$G                                                    
  157.        verify on                                                      
  158.        mode bw80,r                                                    
  159.        type menu                                                      
  160.  
  161.        -- CONFIG.SYS -- is not a DOS command, but a small text file 
  162.        which tells DOS the system setup information or "custom 
  163.        configuration" of your computer. Whenever additional hardware is 
  164.        added such as a tape drive, mouse, ram drive or other device, 
  165.        you will usually add a DEVICE command to the CONFIG.SYS file so 
  166.        that DOS can recognize the new hardware or software device. 
  167.        Performance can also be increased by adding other parameters to 
  168.        the CONFIG.SYS file such as the FILES and BUFFERS commands. On 
  169.        startup, CONFIG.SYS helps DOS determine the configuration of 
  170.        hardware, RAM memory, keyboard, ramdisk, hard drives and other 
  171.        "customizations" to your system and is usually stored in the 
  172.        root or main directory of your hard drive. The CONFIG.SYS file 
  173.        can be prepared or altered with your word processor operating in 
  174.        ASCII mode (plain text). You could also use the COPY CON command 
  175.        or any text editor such as Edlin to prepare a CONFIG.SYS file. 
  176.        Following is a listing of the contents within a sample CONFIG.SYS 
  177.        file: 
  178.  
  179.        device=ansi.sys 
  180.        device=vdisk.sys  
  181.        buffers=20 
  182.        files=20 
  183.               
  184.        -- MODE --  (External) is a command to setup the printer, 
  185.        display and communications outputs of your computer. Use mode 
  186.        when you have several printers or two or more monitors such as 
  187.        both color and monochrome.
  188.  
  189.        Example: A>mode CO80             (set display mode to color,80 
  190.                                         columns wide) 
  191.  
  192.        Example: B>mode lpt1=com1        (set printer to com port number 
  193.                                         1) 
  194.  
  195.        Example: A>mode com1:10,n,8,1,p  (set modem transmission 
  196.                                         settings) 
  197.  
  198.        Example  B>mode bw80,r           (set monitor to b&w text, 80 
  199.                                         columns wide) 
  200.  
  201.        -- MORE -- (External) causes the display to pause when reading a 
  202.        long file or directory. More is always combined with other DOS 
  203.        commands. See below for an example using the MORE command.
  204.  
  205.        -- REDIRECTION AND PIPING -- Are not DOS commands but powerful 
  206.        methods for sending information to or through other DOS 
  207.        utilities.
  208.        
  209.        Some commands, for example DIR, can use MORE, SORT and other DOS 
  210.        "filters" with a special vertical bar | in a method called 
  211.        "piping". Piping is best explained as "filtering" a DOS action 
  212.        through yet another DOS program or command. 
  213.  
  214.        Example A>dir|more              (DIR listing is "piped" through 
  215.                                        MORE to pause after each 
  216.                                        screenful of information) 
  217.                                        Try it with a long listing!
  218.  
  219.        Example: B>type letter.txt|more   (the file letter.txt is "piped" 
  220.                                          through MORE) 
  221.  
  222.        --  < and > -- are input/output symbols. They help DOS send and 
  223.        receive signals properly. You can redirect the output from or 
  224.        towards a particular device. For example if the output of a file 
  225.        normally goes to the screen you could redirect it with the > 
  226.        symbol to the printer. Or you could redirect the input for a DOS 
  227.        command from a file, rather than the keyboard so you would not 
  228.        have to answer a series of questions - the file would provide 
  229.        the keystrokes. 
  230.  
  231.        Example: A>sort<letter.txt>letter.new    (sort letter.txt and 
  232.                                                 output to a new file 
  233.                                                 called letter.new) 
  234.  
  235.        Example: B>dir>prn  (meaning produce a directory listing, but 
  236.        send the output to the printer, rather than the screen) 
  237.  
  238.        Example: format b:<special.txt (format a floppy and accept input 
  239.        keystrokes from the file special.txt rather than input from the 
  240.        keyboard so you don't have to answer yes/no or pause)
  241.  
  242.        These piping and redirection methods are powerful and subtle.
  243.  
  244.        -- SORT -- (External) sorts data lists in alphabetical or 
  245.        reverse order. It is frequently used with redirection and piping 
  246.        methods to sort directories, lists of text or to output its 
  247.        actions into a new file or directly to the printer. 
  248.  
  249.        Example: A>dir|sort    Example: sort<letter.doc>new.doc 
  250.  
  251.        -- GRAPHICS -- (External) allows you to print the contents of a 
  252.        graphics display (e.g., a lotus graph on the screen) while using 
  253.        the SHIFT-PRTSC key combination mentioned earlier. Graphics mode 
  254.        software uses medium resolution CGA color displays or other 
  255.        graphics displays which will not print using the standard SHIFT-
  256.        PRTSC key until the DOS graphics system has been loaded. 
  257.        Graphics is a memory resident program which uses some RAM 
  258.        memory. If a screen display will not print on your printer by 
  259.        tapping SHIFT-PRTSC, trying running graphics first then retry 
  260.        SHIFT-PRTSC.
  261.  
  262.        Example: A>graphics 
  263.  
  264.        -- FIND -- (External) searches for words and phrases in a file. 
  265.        You cannot use wild cards (? and *). You must use quotes 
  266.        surrounding the phrase or word which is sought. 
  267.  
  268.        Example: A>find "chocolate candy bars" letter.txt bones.wks 
  269.  
  270.        (meaning: search for "chocolate candy bars" within the two 
  271.        files letter.txt and bones.wks then report any occurrences)
  272.  
  273.        -- ASSIGN -- (External) tells DOS to send disk requests for one 
  274.        drive to the other. Effectively renames your a drive the b drive 
  275.        and vice versa. Allows you to access only certain drives for 
  276.        security reasons (remote modem use, for example). By itself, 
  277.        assign simply restores the normal drive configurations and 
  278.        names. DISKCOPY and FORMAT commands ignore assign! Use of assign 
  279.        command is rare. 
  280.  
  281.        Example: B>assign c=a 
  282.  
  283.        -- PATH -- (Internal) tells DOS where to search for executable 
  284.        files in the subdirectories you specify. Allows simultaneous 
  285.        searching of many subdirectories at once. Path eliminates the 
  286.        need to search through many subdirectories manually. Frequently 
  287.        a PATH command is used in your autoexec.bat file when starting 
  288.        the computer. A path command is highly recommended for use with 
  289.        all hard drives and, as stated, is embedded within the 
  290.        AUTOEXEC.BAT file as a permanent command. 
  291.  
  292.        Example: C>path \letters;\finance;\utils 
  293.  
  294.        -- PROMPT -- (Internal) allows change of the DOS prompt - for 
  295.        example, the dull A> on screen. $P shows the active directory. 
  296.        $G shows the > symbol. This can be set in the main autoexec.bat 
  297.        file to initialize the prompt every time you start your 
  298.        computer. With the proper commands you can dramatically change 
  299.        your prompt to even display words, pictures or phrases rather 
  300.        than a typical C>
  301.        
  302.        See batch file tutorial covered later. 
  303.  
  304.        Example: A>prompt $P$G.   (result is:    a:\>   ) 
  305.  
  306.        -- TREE -- (External) shows the structure of the subdirectories 
  307.        on your disk. You can check the arrangement of the root (main) 
  308.        and all subdirectories. Tree/f shows all file names. 
  309.  
  310.        Example: B>tree/f 
  311.  
  312.        -- ATTRIB -- (External) allows a file to be set as "read only" 
  313.        (non-erasable). Attrib +r marks for read only. Attrib -r removes 
  314.        this. Protects files from modification or removal. Attrib alone 
  315.        displays file attributes. A small r appears to the left of a 
  316.        files directory listing if that file is read only (protected). 
  317.        Only available in DOS 3.0 and later. 
  318.  
  319.        Example: A>attrib +r letters.doc 
  320.  
  321.        -- BACKUP & RESTORE -- (External) used to making spare copies 
  322.        (backups) of hard disk data. Copies groups of files to floppies. 
  323.        Restore reverses the process and puts the files from floppies to 
  324.        hard disk. Backup/m copies only files modified since the last 
  325.        backup. Backup/s copies all subdirectories and their files. 
  326.        Backup/d copies files modified after the date you specify. 
  327.        Backup/a adds files to a disk that already contains other files. 
  328.        Files copied to floppies with backup can't be used (they are 
  329.        "encoded") until they are restored ("unencoded"). Restore/s puts 
  330.        back all subdirectory files. 
  331.  
  332.        Example: A>backup c:\*.* a:/s 
  333.  
  334.        Example: C>restore a:\*.* c:/s 
  335.  
  336.        -- EDLIN -- (External) is a small word processor/text editor 
  337.        which prepares text files. DOS version 5.0 uses an upgraded 
  338.        text editor called EDIT which is easier to use the Edlin.
  339.       
  340.        Edlin's output is ASCII (plain text). Edlin is rudimentary and 
  341.        provides editing line by line. Other word processors and text 
  342.        editors can output ASCII files more quickly and easily, but 
  343.        Edlin is good for short jobs such as preparing batch files. The 
  344.        COPY CON command (discussed earlier) will do the job also. The 
  345.        entire list of Edlin commands is detailed in your DOS manual. 
  346.  
  347.        Example: A>edlin go.bat  (starts Edlin and loads the file go.bat)
  348.          
  349.        -- RAMDRIVE.SYS -- (used in MS-DOS, see below) (External)
  350.        
  351.        -- VDISK.SYS --  (used in PC-DOS, see below) (External) 
  352.        
  353.        Both of the above files are equivalent "ramdisks" which allow you 
  354.        to construct an artificial software disk drive in RAM computer 
  355.        memory. It is very fast and is also known as a virtual disk. 
  356.        RAMDRIVE.SYS or VDISK.SYS is usually placed in the CONFIG.SYS 
  357.        file via the DEVICE command. RAMDRIVE.SYS or VDISK.SYS is 
  358.        available in DOS 3.0 and later. DOS 2.0 users can use 
  359.        alternative "add in" RAMDISK utilities to produce the same 
  360.        result. Within the CONFIG.SYS file the following statement might 
  361.        appear for users of this device: 
  362.  
  363.        Example: device=vdisk.sys 128    (sets up a ramdisk of 128,000 
  364.                                         bytes in size) 
  365.        
  366.  
  367.        Tutorial finished. Have you registered PC-Learn to receive your
  368.        bonus disks? Registration is encouraged. Shareware works on the
  369.        honor system! Send $25 to Seattle Scientific Photography, 
  370.        Department PCL6, PO Box 1506, Mercer Island, WA 98040. Latest 
  371.        version of PC-Learn and two bonus disks shipped promptly!
  372.  
  373.